﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public static class ErrorExceptionHandlingExtension
    {
        public static void TryCatch<T>(this T anonymousObjectType, Action<T> execAction)
        {
            try
            {
                execAction(anonymousObjectType);
            }
            catch (Exception ex)
            {
            }
        }

        public static void TryCatchThrow<T>(this T anonymousObjectType, Action<T> execAction)
        {
            try
            {
                execAction(anonymousObjectType);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
